settings.outformat="pdf";

real len=50;
pair O=0,	A=O+(len,-len),	B=O+(2*len,len),	C=O+(0,len),
	 D=B+(0,len),	G=D+(len,0),	H=A+(len,0);

int n=4;
path cube = box(O,O+(len,len));
pen[] cl = {red,blue,green,yellow,olive,cyan};
for ( int i=0; i<4; ++i )
filldraw( shift( O+(i*len,0) ) * cube, cl[i], currentpen );

filldraw( shift(B) * cube, cl[4], currentpen );
filldraw( shift(A) * cube, cl[5], currentpen );

real ot=5;

draw( O -- O+(-ot,ot) -- C-(ot,ot) -- C, gray );
draw( A -- A+(ot,-ot) -- H-(ot,ot) -- H, gray );
draw( D -- D+(ot,ot) -- G+(-ot,ot) -- G, gray );




